﻿using System.Collections.ObjectModel;
using System.Diagnostics;
using Gwn.Library.MvpVm.Base;
using Gwn.Library.MvpVm.Constants;
using Gwn.Library.MvpVm.Entities;
using Gwn.Library.MvpVm.Events;
using Gwn.Module.UserManager.Interfaces;
using Microsoft.Practices.Unity;
using Gwn.Library.MvpVm.Interfaces;

namespace Gwn.Module.Security.Commands
{
    /// <summary>
    /// Login button command
    /// </summary>
    public class LoginCommand : CommandBase
    {
        /// <summary>
        /// Gets or sets the app controller.
        /// </summary>
        /// <value>The app controller.</value>
        [Dependency]
        public IApplicationController AppController { get; set; }


        /// <summary>
        /// Defines the method to be called when the command is invoked.
        /// </summary>
        /// <param name="parameter">Data used by the command. If the command does not require data to be passed, this object can be set to null.</param>
        public override void Execute(object parameter)
        {
            base.Execute(parameter);

            // Switch to the UserManager view
            AppController.ActivateView(ConstantModules.UserManagerModule);
        }

    }
}
